package com.hanthink.web.controller.app.repair;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.hanthink.common.constant.BusinessConstants;
import com.hanthink.common.core.text.Convert;
import com.hanthink.quartz.task.SendWeChatMessage;
import com.hanthink.system.domain.pc.EmEquip;
import com.hanthink.system.domain.repair.EquipRepairMessageVo;
import com.hanthink.system.domain.repair.RepairRecordInfo;
import com.hanthink.system.mapper.EmEquipMapper;
import com.hanthink.system.mapper.repair.EquipRepairMapper;
import com.hanthink.system.mapper.repair.RepairRecoedMapper;
import com.hanthink.system.mapper.repair.RequestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.hanthink.common.annotation.Log;
import com.hanthink.common.constant.HttpStatus;
import com.hanthink.common.core.controller.BaseController;
import com.hanthink.common.core.domain.AjaxResult;
import com.hanthink.common.core.domain.model.LoginUser;
import com.hanthink.common.core.page.TableDataInfo;
import com.hanthink.common.enums.BusinessType;
import com.hanthink.common.utils.ServletUtils;
import com.hanthink.framework.web.service.TokenService;
import com.hanthink.system.domain.repair.RequestInfo;
import com.hanthink.system.service.repair.IResquestInfoService;

@RestController
@RequestMapping("/app/repair/requestInfo")
public class RequestInfoControll extends BaseController {

    @Autowired
    private IResquestInfoService resquestInfoService;

    @Autowired
    private TokenService tokenService;

    @Autowired
    private EquipRepairMapper equipRepairMapper;


    @Autowired
    private EmEquipMapper emEquipMapper;

    @Autowired
    private RepairRecoedMapper repairRecoedMapper;

    @PostMapping("/insertRequest")
    public TableDataInfo insertRequest(@RequestBody RequestInfo requestInfo) {
        resquestInfoService.insertRequest(requestInfo);
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }


    @PostMapping("/list")
    public TableDataInfo list(@RequestBody RequestInfo requestInfo) {
        startPage();
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            requestInfo.setSiteKey(loginUser.getUser().getSite());
        }
        List<RequestInfo> list = resquestInfoService.selectRequestinforList(requestInfo.getSiteKey());
        return getDataTable(list);
    }

    @PostMapping("/listordernotget")
    public TableDataInfo listordernotget(@RequestBody Map<String, Object> map) {
        startPage();
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        Map<String, Object> params = new HashMap<String, Object>();
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            params.put("siteKey", loginUser.getUser().getSite());
        }
        for (int e = 0; e < loginUser.getUser().getRoles().size(); e++) {
            if (loginUser.getUser().getRoles().get(e).getRoleName().contains("隐患")) {
                String[] temp = loginUser.getUser().getRoles().get(e).getRoleName().split("-");
                params.put("deptname", temp[1]);
                break;
            }
        }
        List<RequestInfo> list = resquestInfoService.selectRequestinforListnotget(params);
        return getDataTable(list);
    }


    @PostMapping("/listorderget")
    public TableDataInfo listorderget(@RequestBody Map<String, Object> map) {
        startPage();
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        Map<String, Object> params = new HashMap<String, Object>();
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            params.put("siteKey", loginUser.getUser().getSite());
        }
        for (int e = 0; e < loginUser.getUser().getRoles().size(); e++) {
            if (loginUser.getUser().getRoles().get(e).getRoleName().contains("隐患")) {
                String[] temp = loginUser.getUser().getRoles().get(e).getRoleName().split("-");
                params.put("deptname", temp[1]);
                break;
            }
        }
        List<RequestInfo> list = resquestInfoService.selectRequestinforListget(params);
        return getDataTable(list);
    }


    @PostMapping("/listfirst")
    public TableDataInfo listfirst(@RequestBody Map<String, Object> map) {
        startPage();
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("siteKey", loginUser.getUser().getSite());
        params.put("firstlevelreview", map.get("firstlevelreview"));
        List<RequestInfo> list = resquestInfoService.selectRequestinforListPlus(params);
        return getDataTable(list);
    }

    @PostMapping("/updateassign")
    public TableDataInfo updateassign(@RequestBody Map<String, Object> map) {
        TableDataInfo rspData = new TableDataInfo();
        // 参数验证
        if (map == null || map.isEmpty()) {
            rspData.setCode(HttpStatus.BAD_REQUEST);
            rspData.setMsg("请求参数不能为空");
            return rspData;
        }
        // 必要字段验证
        if (!map.containsKey("id") || map.get("id") == null) {
            rspData.setCode(HttpStatus.BAD_REQUEST);
            rspData.setMsg("参数'id'不能为空");
            return rspData;
        }
        if (!map.containsKey("roleName") || map.get("roleName") == null || "".equals(map.get("roleName"))) {
            rspData.setCode(HttpStatus.BAD_REQUEST);
            rspData.setMsg("参数'roleName'不能为空");
            return rspData;
        }
        resquestInfoService.updateassign(map);
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }


    @PostMapping("/listallocation")
    public TableDataInfo listallocation(@RequestBody Map<String, Object> map) {
        startPage();
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("siteKey", loginUser.getUser().getSite());
        List<RequestInfo> list = resquestInfoService.selectRequestinforListallocation(params);
        return getDataTable(list);
    }


    @PostMapping("/listbx")
    public TableDataInfo listbx(@RequestBody RequestInfo requestInfo) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            requestInfo.setSiteKey(loginUser.getUser().getSite());
        }
        List<RequestInfo> list = resquestInfoService.selectRequestinforListbx(requestInfo.getSiteKey());
        return getDataTable(list);
    }

    @PostMapping("/listbxbyCode")
    public TableDataInfo listbxbyCode(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
//		if (loginUser.getUser().getDept().getParentId() != 0L) {
//			requestInfo.setSiteKey(loginUser.getUser().getSite());
//		}
        //获取设备ID
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("siteKey", loginUser.getUser().getSite());
        params.put("equipcode", map.get("equipcode"));

        List<RequestInfo> list = resquestInfoService.selectRequestinforListbxbyCode(params);
        return getDataTable(list);
    }

    @PostMapping("/updateRequest")
    @Log(title = "报修单指派", businessType = BusinessType.UPDATE)
    public TableDataInfo updateRequest(@RequestBody Map<String, Object> map) {
        resquestInfoService.updateRequest(map);
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }

    @PostMapping("/orderRequest")
    @Log(title = "报修单接单", businessType = BusinessType.UPDATE)
    public TableDataInfo orderRequest(@RequestBody Map<String, Object> map) {
        resquestInfoService.orderRequest(map);
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }

    @PostMapping("/orderRequestplus")
    @Log(title = "隐患排查接单", businessType = BusinessType.UPDATE)
    public TableDataInfo orderRequestplus(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        map.put("deptid", loginUser.getUser().getParentid());
        resquestInfoService.orderRequestplus(map);
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }

    @PostMapping("/orderRequestget")
    @Log(title = "隐患排查接单", businessType = BusinessType.UPDATE)
    public TableDataInfo orderRequestget(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        map.put("deptid", loginUser.getUser().getParentid());
        resquestInfoService.orderRequestget(map);
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }


    @PostMapping("/orderRequestplusfirst")
    @Log(title = "分管领导审核", businessType = BusinessType.UPDATE)
    public TableDataInfo orderRequestplusfirst(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        map.put("deptid", loginUser.getUser().getParentid());
        resquestInfoService.orderRequestplusfirst(map);
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }


    /**
     * 查询已审核报修单
     *
     * @param siteKey
     * @return
     */
    @PostMapping("/checkedList")
    public TableDataInfo selectCheckedList(Long siteKey) {
        startPage();
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            siteKey = loginUser.getUser().getSite();
        }
        List<RequestInfo> list = resquestInfoService.selectCheckedList(siteKey);
        return getDataTable(list);
    }

    /**
     * 查找争议未发起信息
     *
     * @param siteKey
     * @return
     */
    @PostMapping("/checkedListzhengyi1")
    public TableDataInfo checkedListzhengyi1(Long siteKey) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            siteKey = loginUser.getUser().getSite();
        }
        List<RequestInfo> list = resquestInfoService.checkedListzhengyi1(loginUser.getUser().getUserName());
        return getDataTable(list);
    }

    /**
     * 查找争议已发起界面
     *
     * @param siteKey
     * @return
     */
    @PostMapping("/checkedListzhengyi2")
    public TableDataInfo checkedListzhengyi2(Long siteKey) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            siteKey = loginUser.getUser().getSite();
        }
        List<RequestInfo> list = resquestInfoService.checkedListzhengyi2(loginUser.getUser().getUserName());
        return getDataTable(list);
    }

    /**
     * 发起并修
     *
     * @param map
     * @return
     */
    @PostMapping("/checkedListzhengyi3")
    public TableDataInfo checkedListzhengyi3(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        resquestInfoService.checkedListzhengyi3(Convert.toLong(map.get("id").toString()));
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("id", map.get("id").toString());
        List<RequestInfo> rf = resquestInfoService.checkedListzhengyi15(params);
        switch (loginUser.getUser().getDeptId().toString()) {
            //太仓
            case "101":
                SendWeChatMessage.sendWeChatMessagesj("3743", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3942", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5949", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3750", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("1466", "", "", "并修发起", "0", "提醒", rf.get(0));

                break;
            case "240":
                SendWeChatMessage.sendWeChatMessagesj("2393", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3950", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3967", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("473", "", "", "并修发起", "0", "提醒", rf.get(0));

                break;
            case "253":
                SendWeChatMessage.sendWeChatMessagesj("4598", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3246", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5438", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2951", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("433", "", "", "并修发起", "0", "提醒", rf.get(0));

                break;

            case "246":
                SendWeChatMessage.sendWeChatMessagesj("2507", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2062", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2265", "", "", "并修发起", "0", "提醒", rf.get(0));

                break;

            case "229":
                SendWeChatMessage.sendWeChatMessagesj("3380", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3305", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "并修发起", "0", "提醒", rf.get(0));

                break;
            case "231":
                SendWeChatMessage.sendWeChatMessagesj("2515", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "并修发起", "0", "提醒", rf.get(0));

                break;

            case "604":
                SendWeChatMessage.sendWeChatMessagesj("2513", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "并修发起", "0", "提醒", rf.get(0));

                break;

            case "608":
                SendWeChatMessage.sendWeChatMessagesj("2938", "", "", "并修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "并修发起", "0", "提醒", rf.get(0));

                break;

        }
        //SendWeChatMessage.sendWeChatMessagesj("5355", "", "", "并修发起", "0", "提醒",rf.get(0));
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }

    /**
     * 发起抢修
     *
     * @param map
     * @return
     */
    @PostMapping("/checkedListzhengyi31")
    public TableDataInfo checkedListzhengyi31(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        resquestInfoService.checkedListzhengyi31(Convert.toLong(map.get("id").toString()));
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("id", map.get("id").toString());
        List<RequestInfo> rf = resquestInfoService.checkedListzhengyi15(params);

        switch (loginUser.getUser().getDeptId().toString()) {
            //太仓
            case "101":
                SendWeChatMessage.sendWeChatMessagesj("3743", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3942", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5949", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3750", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("1466", "", "", "抢修发起", "0", "提醒", rf.get(0));

                break;
            case "240":
                SendWeChatMessage.sendWeChatMessagesj("2393", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3950", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3967", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("473", "", "", "抢修发起", "0", "提醒", rf.get(0));

                break;
            case "253":
                SendWeChatMessage.sendWeChatMessagesj("4598", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3246", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5438", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2951", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("433", "", "", "抢修发起", "0", "提醒", rf.get(0));

                break;

            case "246":
                SendWeChatMessage.sendWeChatMessagesj("2507", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2062", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2265", "", "", "抢修发起", "0", "提醒", rf.get(0));

                break;

            case "229":
                SendWeChatMessage.sendWeChatMessagesj("3380", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3305", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "抢修发起", "0", "提醒", rf.get(0));

                break;
            case "231":
                SendWeChatMessage.sendWeChatMessagesj("2515", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "抢修发起", "0", "提醒", rf.get(0));

                break;

            case "604":
                SendWeChatMessage.sendWeChatMessagesj("2513", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "抢修发起", "0", "提醒", rf.get(0));

                break;

            case "608":
                SendWeChatMessage.sendWeChatMessagesj("2938", "", "", "抢修发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "抢修发起", "0", "提醒", rf.get(0));

                break;

        }
        //SendWeChatMessage.sendWeChatMessagesj("5355", "", "", "抢修发起", "0", "提醒",rf.get(0));
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }

    /**
     * 同时发起
     *
     * @param map
     * @return
     */
    @PostMapping("/checkedListzhengyi32")
    public TableDataInfo checkedListzhengyi32(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        resquestInfoService.checkedListzhengyi32(Convert.toLong(map.get("id").toString()));
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("id", map.get("id").toString());
        List<RequestInfo> rf = resquestInfoService.checkedListzhengyi15(params);
        switch (loginUser.getUser().getDeptId().toString()) {
            //太仓
            case "101":
                SendWeChatMessage.sendWeChatMessagesj("3743", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3942", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5949", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3750", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("1466", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));

                break;
            case "240":
                SendWeChatMessage.sendWeChatMessagesj("2393", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3950", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3967", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("473", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));

                break;
            case "253":
                SendWeChatMessage.sendWeChatMessagesj("4598", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3246", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5438", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2951", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("433", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));

                break;

            case "246":
                SendWeChatMessage.sendWeChatMessagesj("2507", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2062", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2265", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));

                break;

            case "229":
                SendWeChatMessage.sendWeChatMessagesj("3380", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3305", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));

                break;
            case "231":
                SendWeChatMessage.sendWeChatMessagesj("2515", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));

                break;

            case "604":
                SendWeChatMessage.sendWeChatMessagesj("2513", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));

                break;

            case "608":
                SendWeChatMessage.sendWeChatMessagesj("2938", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "并修和抢修同时发起", "0", "提醒", rf.get(0));

                break;

        }

        //SendWeChatMessage.sendWeChatMessagesj("5355", "", "", "并修和抢修同时发起", "0", "提醒",rf.get(0));
        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }


    /**
     * 查找争议未发起信息
     *
     * @param siteKey
     * @return
     */
    @PostMapping("/checkedListzhengyi4")
    public TableDataInfo checkedListzhengyi4(Long siteKey) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            siteKey = loginUser.getUser().getSite();
        }
        List<RequestInfo> list = resquestInfoService.checkedListzhengyi4(siteKey);
        return getDataTable(list);
    }


    @PostMapping("/checkedListzhengyi99")
    public TableDataInfo checkedListzhengyi99(@RequestBody Map<String, Object> map) {
        List<RequestInfo> list = resquestInfoService.checkedListzhengyi99(map);
        return getDataTable(list);
    }


    /**
     * 查找争议已发起界面
     *
     * @param siteKey
     * @return
     */
    @PostMapping("/checkedListzhengyi5")
    public TableDataInfo checkedListzhengyi5(Long siteKey) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            siteKey = loginUser.getUser().getSite();
        }
        List<RequestInfo> list = resquestInfoService.checkedListzhengyi5(siteKey);
        return getDataTable(list);
    }


    @PostMapping("/checkedListzhengyi6")
    public TableDataInfo checkedListzhengyi6(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        map.put("user", loginUser.getUser().getNickName().toString());
        resquestInfoService.checkedListzhengyi6(map);

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("id", map.get("id").toString());
        List<RequestInfo> rf = resquestInfoService.checkedListzhengyi15(params);


        //SendWeChatMessage.sendWeChatMessagesj("5355", "", "", "并修处理", "0", "提醒",rf.get(0));


        RepairRecordInfo re = repairRecoedMapper.selectRecordByIdplus(Long.valueOf(map.get("id").toString()));
        EquipRepairMessageVo equipRepairMessageVo = new EquipRepairMessageVo();
        equipRepairMessageVo.setIsPush(BusinessConstants.IS_PUSH_TRUE);
        equipRepairMessageVo.setIsRead(BusinessConstants.IS_READ_FALSE);
        equipRepairMessageVo.setNewsType("争议处理");
        equipRepairMessageVo.setNotingUser(re.getRepairUser());
        equipRepairMessageVo.setSiteKey(Long.valueOf(loginUser.getUser().getSite().toString()));

        Long relationId = Long.valueOf(map.get("id").toString());
        equipRepairMessageVo.setRelationId(relationId);

        int newsiteKey = Integer.valueOf(loginUser.getUser().getSite().toString());
        Long site = (long) newsiteKey;
        equipRepairMessageVo.setEqKey(re.getEqKey());
        // 根据设备id查询设备信息
        EmEquip emEquip = emEquipMapper.selectEmEquipById(re.getEqKey());
        equipRepairMessageVo.setNewsDesc(rf.get(0).toStringsj5());
        equipRepairMapper.saveEquipRepairMessageInfo(equipRepairMessageVo);


        switch (loginUser.getUser().getDeptId().toString()) {
            //太仓
            case "101":
                SendWeChatMessage.sendWeChatMessagesj("3743", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3942", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5949", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3750", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("1466", "", "", "并修处理", "0", "提醒", rf.get(0));

                break;
            case "240":
                SendWeChatMessage.sendWeChatMessagesj("2393", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3950", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3967", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("473", "", "", "并修处理", "0", "提醒", rf.get(0));

                break;
            case "253":
                SendWeChatMessage.sendWeChatMessagesj("4598", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3246", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5438", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2951", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("433", "", "", "并修处理", "0", "提醒", rf.get(0));

                break;

            case "246":
                SendWeChatMessage.sendWeChatMessagesj("2507", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2062", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2265", "", "", "并修处理", "0", "提醒", rf.get(0));

                break;

            case "229":
                SendWeChatMessage.sendWeChatMessagesj("3380", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3305", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "并修处理", "0", "提醒", rf.get(0));

                break;
            case "231":
                SendWeChatMessage.sendWeChatMessagesj("2515", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "并修处理", "0", "提醒", rf.get(0));

                break;

            case "604":
                SendWeChatMessage.sendWeChatMessagesj("2513", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "并修处理", "0", "提醒", rf.get(0));

                break;

            case "608":
                SendWeChatMessage.sendWeChatMessagesj("2938", "", "", "并修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "并修处理", "0", "提醒", rf.get(0));

                break;

        }

        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }


    /**
     * 设备部审核抢修订单
     *
     * @param map
     * @return
     */
    @PostMapping("/checkedListzhengyi88")
    public TableDataInfo checkedListzhengyi88(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        map.put("user", loginUser.getUser().getNickName().toString());
        resquestInfoService.checkedListzhengyi88(map);

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("id", map.get("id").toString());
        List<RequestInfo> rf = resquestInfoService.checkedListzhengyi15(params);


        RepairRecordInfo re = repairRecoedMapper.selectRecordByIdplus(Long.valueOf(map.get("id").toString()));
        EquipRepairMessageVo equipRepairMessageVo = new EquipRepairMessageVo();
        equipRepairMessageVo.setIsPush(BusinessConstants.IS_PUSH_TRUE);
        equipRepairMessageVo.setIsRead(BusinessConstants.IS_READ_FALSE);
        equipRepairMessageVo.setNewsType("重大隐患审核处理");
        equipRepairMessageVo.setNotingUser(re.getRepairUser());
        equipRepairMessageVo.setSiteKey(Long.valueOf(loginUser.getUser().getSite().toString()));

        Long relationId = Long.valueOf(map.get("id").toString());
        equipRepairMessageVo.setRelationId(relationId);

        int newsiteKey = Integer.valueOf(loginUser.getUser().getSite().toString());
        Long site = (long) (newsiteKey);
        equipRepairMessageVo.setEqKey(re.getEqKey());
        // 根据设备id查询设备信息
        EmEquip emEquip = emEquipMapper.selectEmEquipById(re.getEqKey());
        equipRepairMessageVo.setNewsDesc(rf.get(0).toStringsj5());
        equipRepairMapper.saveEquipRepairMessageInfo(equipRepairMessageVo);


        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }


    @PostMapping("/checkedListzhengyi61")
    public TableDataInfo checkedListzhengyi61(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        map.put("user", loginUser.getUser().getNickName().toString());
        resquestInfoService.checkedListzhengyi61(map);

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("id", map.get("id").toString());
        List<RequestInfo> rf = resquestInfoService.checkedListzhengyi15(params);
        //SendWeChatMessage.sendWeChatMessagesj("5355", "", "", "抢修处理", "0", "提醒",rf.get(0));


        RepairRecordInfo re = repairRecoedMapper.selectRecordByIdplus(Long.valueOf(map.get("id").toString()));
        EquipRepairMessageVo equipRepairMessageVo = new EquipRepairMessageVo();
        equipRepairMessageVo.setIsPush(BusinessConstants.IS_PUSH_TRUE);
        equipRepairMessageVo.setIsRead(BusinessConstants.IS_READ_FALSE);
        equipRepairMessageVo.setNewsType("争议处理");
        equipRepairMessageVo.setNotingUser(re.getRepairUser());
        equipRepairMessageVo.setSiteKey(Long.valueOf(loginUser.getUser().getSite().toString()));

        Long relationId = Long.valueOf(map.get("id").toString());
        equipRepairMessageVo.setRelationId(relationId);

        int newsiteKey = Integer.valueOf(loginUser.getUser().getSite().toString());
        Long site = (long) newsiteKey;
        equipRepairMessageVo.setEqKey(re.getEqKey());
        // 根据设备id查询设备信息
        EmEquip emEquip = emEquipMapper.selectEmEquipById(re.getEqKey());
        equipRepairMessageVo.setNewsDesc(rf.get(0).toStringsj5());
        equipRepairMapper.saveEquipRepairMessageInfo(equipRepairMessageVo);


        switch (loginUser.getUser().getDeptId().toString()) {
            //太仓
            case "101":
                SendWeChatMessage.sendWeChatMessagesj("3743", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3942", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5949", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3750", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("1466", "", "", "抢修处理", "0", "提醒", rf.get(0));

                break;
            case "240":
                SendWeChatMessage.sendWeChatMessagesj("2393", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3950", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3967", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("473", "", "", "抢修处理", "0", "提醒", rf.get(0));

                break;
            case "253":
                SendWeChatMessage.sendWeChatMessagesj("4598", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3246", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5438", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2951", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("433", "", "", "抢修处理", "0", "提醒", rf.get(0));

                break;

            case "246":
                SendWeChatMessage.sendWeChatMessagesj("2507", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2062", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2265", "", "", "抢修处理", "0", "提醒", rf.get(0));

                break;

            case "229":
                SendWeChatMessage.sendWeChatMessagesj("3380", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3305", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "抢修处理", "0", "提醒", rf.get(0));

                break;
            case "231":
                SendWeChatMessage.sendWeChatMessagesj("2515", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "抢修处理", "0", "提醒", rf.get(0));

                break;

            case "604":
                SendWeChatMessage.sendWeChatMessagesj("2513", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "抢修处理", "0", "提醒", rf.get(0));

                break;

            case "608":
                SendWeChatMessage.sendWeChatMessagesj("2938", "", "", "抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "抢修处理", "0", "提醒", rf.get(0));

                break;

        }

        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }


    /**
     * 抢修未审核查询
     *
     * @param siteKey
     * @return
     */
    @PostMapping("/checkedListzhengyi50")
    public TableDataInfo checkedListzhengyi50(Long siteKey) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            siteKey = loginUser.getUser().getSite();
        }
        List<RequestInfo> list = resquestInfoService.checkedListzhengyi50(siteKey);
        return getDataTable(list);
    }

    /**
     * 抢修已审核查询
     *
     * @param siteKey
     * @return
     */
    @PostMapping("/checkedListzhengyi51")
    public TableDataInfo checkedListzhengyi51(Long siteKey) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getDept().getParentId() != 0L) {
            siteKey = loginUser.getUser().getSite();
        }
        List<RequestInfo> list = resquestInfoService.checkedListzhengyi51(siteKey);
        return getDataTable(list);
    }


    @PostMapping("/checkedListzhengyi62")
    public TableDataInfo checkedListzhengyi62(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        map.put("user", loginUser.getUser().getNickName().toString());
        resquestInfoService.checkedListzhengyi62(map);

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("id", map.get("id").toString());
        List<RequestInfo> rf = resquestInfoService.checkedListzhengyi15(params);
        //SendWeChatMessage.sendWeChatMessagesj("5355", "", "", "并修和抢修处理", "0", "提醒",rf.get(0));


        RepairRecordInfo re = repairRecoedMapper.selectRecordByIdplus(Long.valueOf(map.get("id").toString()));
        EquipRepairMessageVo equipRepairMessageVo = new EquipRepairMessageVo();
        equipRepairMessageVo.setIsPush(BusinessConstants.IS_PUSH_TRUE);
        equipRepairMessageVo.setIsRead(BusinessConstants.IS_READ_FALSE);
        equipRepairMessageVo.setNewsType("争议处理");
        equipRepairMessageVo.setNotingUser(re.getRepairUser());
        equipRepairMessageVo.setSiteKey(Long.valueOf(loginUser.getUser().getSite().toString()));

        Long relationId = Long.valueOf(map.get("id").toString());
        equipRepairMessageVo.setRelationId(relationId);

        int newsiteKey = Integer.valueOf(loginUser.getUser().getSite().toString());
        Long site = (long) newsiteKey;
        equipRepairMessageVo.setEqKey(re.getEqKey());
        // 根据设备id查询设备信息
        EmEquip emEquip = emEquipMapper.selectEmEquipById(re.getEqKey());
        equipRepairMessageVo.setNewsDesc(rf.get(0).toStringsj5());
        equipRepairMapper.saveEquipRepairMessageInfo(equipRepairMessageVo);


        switch (loginUser.getUser().getDeptId().toString()) {
            //太仓
            case "101":
                SendWeChatMessage.sendWeChatMessagesj("3743", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3942", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5949", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3750", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("1466", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));

                break;
            case "240":
                SendWeChatMessage.sendWeChatMessagesj("2393", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3950", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3967", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("473", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));

                break;
            case "253":
                SendWeChatMessage.sendWeChatMessagesj("4598", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3246", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5438", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2951", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("433", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));

                break;

            case "246":
                SendWeChatMessage.sendWeChatMessagesj("2507", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2062", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2265", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));

                break;

            case "229":
                SendWeChatMessage.sendWeChatMessagesj("3380", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3305", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));

                break;
            case "231":
                SendWeChatMessage.sendWeChatMessagesj("2515", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));

                break;

            case "604":
                SendWeChatMessage.sendWeChatMessagesj("2513", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));

                break;

            case "608":
                SendWeChatMessage.sendWeChatMessagesj("2938", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "并修和抢修处理", "0", "提醒", rf.get(0));

                break;

        }

        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }


    @PostMapping("/checkedListzhengyi7")
    public TableDataInfo checkedListzhengyi7(@RequestBody Map<String, Object> map) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        map.put("user", loginUser.getUser().getNickName().toString());
        resquestInfoService.checkedListzhengyi7(map);

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("id", map.get("id").toString());
        List<RequestInfo> rf = resquestInfoService.checkedListzhengyi15(params);
        //SendWeChatMessage.sendWeChatMessagesj("5355", "", "", "驳回", "0", "提醒",rf.get(0));

        RepairRecordInfo re = repairRecoedMapper.selectRecordByIdplus(Long.valueOf(map.get("id").toString()));
        EquipRepairMessageVo equipRepairMessageVo = new EquipRepairMessageVo();
        equipRepairMessageVo.setIsPush(BusinessConstants.IS_PUSH_TRUE);
        equipRepairMessageVo.setIsRead(BusinessConstants.IS_READ_FALSE);
        equipRepairMessageVo.setNewsType("争议处理");
        equipRepairMessageVo.setNotingUser(re.getRepairUser());
        equipRepairMessageVo.setSiteKey(Long.valueOf(loginUser.getUser().getSite().toString()));

        Long relationId = Long.valueOf(map.get("id").toString());
        equipRepairMessageVo.setRelationId(relationId);

        int newsiteKey = Integer.valueOf(loginUser.getUser().getSite().toString());
        Long site = (long) newsiteKey;
        equipRepairMessageVo.setEqKey(re.getEqKey());
        // 根据设备id查询设备信息
        EmEquip emEquip = emEquipMapper.selectEmEquipById(re.getEqKey());
        equipRepairMessageVo.setNewsDesc(rf.get(0).toStringsj5());
        equipRepairMapper.saveEquipRepairMessageInfo(equipRepairMessageVo);


        switch (loginUser.getUser().getDeptId().toString()) {
            //太仓
            case "101":
                SendWeChatMessage.sendWeChatMessagesj("3743", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3942", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5949", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3750", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("1466", "", "", "驳回", "0", "提醒", rf.get(0));

                break;
            case "240":
                SendWeChatMessage.sendWeChatMessagesj("2393", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3950", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3967", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("473", "", "", "驳回", "0", "提醒", rf.get(0));

                break;
            case "253":
                SendWeChatMessage.sendWeChatMessagesj("4598", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3246", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("5438", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2951", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("433", "", "", "驳回", "0", "提醒", rf.get(0));

                break;

            case "246":
                SendWeChatMessage.sendWeChatMessagesj("2507", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2062", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("2265", "", "", "驳回", "0", "提醒", rf.get(0));

                break;

            case "229":
                SendWeChatMessage.sendWeChatMessagesj("3380", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("3305", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "驳回", "0", "提醒", rf.get(0));

                break;
            case "231":
                SendWeChatMessage.sendWeChatMessagesj("2515", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "驳回", "0", "提醒", rf.get(0));

                break;

            case "604":
                SendWeChatMessage.sendWeChatMessagesj("2513", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("474", "", "", "驳回", "0", "提醒", rf.get(0));

                break;

            case "608":
                SendWeChatMessage.sendWeChatMessagesj("2938", "", "", "驳回", "0", "提醒", rf.get(0));
                SendWeChatMessage.sendWeChatMessagesj("402", "", "", "驳回", "0", "提醒", rf.get(0));

                break;

        }

        TableDataInfo rspData = new TableDataInfo();
        rspData.setCode(HttpStatus.SUCCESS);
        rspData.setMsg("操作成功");
        return rspData;
    }

    @PostMapping("/checkedListzhengyi10")
    public TableDataInfo checkedListzhengyi10(@RequestBody Map<String, Object> map) {
        List<RequestInfo> list = resquestInfoService.checkedListzhengyi10(map);
        return getDataTable(list);
    }


    /**
     * 查询未完成维修的报修单
     *
     * @param requestInfo 报修单
     * @return
     */
    @PostMapping("/noFinishedRequest")
    public AjaxResult selectNoFinishedRequestVo(@RequestBody RequestInfo requestInfo) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getSite() != null && loginUser.getUser().getDept().getParentId() != 0L) {
            requestInfo.setSiteKey(loginUser.getUser().getSite());
        }
        List<RequestInfo> list = resquestInfoService.selectNoFinishedRequestVo(requestInfo);
        return AjaxResult.success(list);
    }

    /**
     * 报修单催促
     *
     * @param requestInfo 报修单
     * @return
     */
    @PostMapping("/promptRequest")
    public AjaxResult orderPrompt(@RequestBody RequestInfo requestInfo) {
        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
        if (loginUser.getUser().getSite() != null && loginUser.getUser().getDept().getParentId() != 0L) {
            requestInfo.setSiteKey(loginUser.getUser().getSite());
        }
        return resquestInfoService.orderPrompt(requestInfo.getId(), loginUser);
    }

    public TableDataInfo getOverTimeRequest() {
        List<RequestInfo> list = resquestInfoService.selectCheckedListOverTime();
        return getDataTable(list);
    }

    public void updateOverTimeRequest(Long id) {
        resquestInfoService.updateCheckedListOverTime(id);
    }

//	@PostMapping("/selectRequestVoByName")
//	public String selectRequestVoByName(String equipName){
//		return resquestInfoService.selectRequestVoByName(equipName);
//	}


    @GetMapping("/selectRequestVoByName")
    public JsonElement selectRequestVoByName(String equipName) {
        String jsonstring = resquestInfoService.selectRequestVoByName(equipName);
        Gson gson = new Gson();
        JsonElement jsonElement = gson.fromJson(jsonstring, JsonElement.class);
        //JSONObject jsonObj = JSON.parseObject();
        return jsonElement;
    }

}
